package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.PointDao;
import cn.topevery.garden.entity.po.Point;
import cn.topevery.garden.entity.query.PointQuery;
import cn.topevery.garden.entity.vo.PointVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PointLogic extends BaseLogic<Point> {
    @Autowired
    private PointDao pointDao;

    @Override
    public BaseEntityDao<Point, Integer> getDao() {
        return pointDao;
    }

    public DataPager<PointVO> listPage(PointQuery query) {
        return pointDao.listPage(query);
    }

    public void saveOrUpdate(String userId, Point record) {
        pointDao.saveOrUpdate(userId, record);
    }

    public void deleteBatchById(String userId, Integer[] ids) {
        pointDao.deleteBatchById(userId, ids);
    }

    public DataPager<PointVO> getPointListBySectionId(PointQuery query) {
        return pointDao.getPointListBySectionId(query);
    }

    public void setPointStatus(List<Integer> idList, Integer status) {
        pointDao.setPointStatus(idList, status);
    }

    public List<Map<String, Object>> getListBySectionId(Integer sectionId) {
        return pointDao.getListBySectionId(sectionId);
    }
}
